package com.atguigu.rule;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author : wenchao.long
 * @date : Created in 2020/12/13 16:59:42 周日
 * @description :
 */
@Configuration
public class RibbonRuleConfig {

    @Bean
    public IRule rule() {
        // 设置为随机
        // 原理 + JUC(CAS + 自旋锁)
        return new RandomRule();
    }
}
